<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.jxLC.Action.*"%>
<%@ page language="java" import="com.jxLC.Model.*" %>
<%@ page language="java" import="com.jxLC.Service.*" %>
<%@ page import="com.jxLC.util.*"%><%@page import="com.sun.corba.se.impl.encoding.CodeSetConversion.CTBConverter"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ContentService contentService=new ContentService();
List<Content> contents=new ArrayList<Content>();
contents=contentService.getcontent(4);

%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>:::江西低碳:::</title>
	<link href="/mycss/my.css"  rel="stylesheet" type="text/css" />
	<link href="/mycss/details.css"  rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/myjs/my.js"></script>
    <style type="text/css">
     #m{height:700px;}
     table{background-color:#FFFFFF;border:1px solid #009966;border-top:5px solid #009966;width:800px;}
     table a{font-size:13px; text-decoration: none;color:black;font-face:"宋"}
     table a:hover{color:red;}
     #ma{margin-top:10px;margin-bottom:20px;}
     #ma1{margin-left:20px;margin-top:4px;margin-bottom:10px;padding-left:4px;padding-top:4px;height:20px;background-color:;}
     #ma2{width:800px;color:#009966; height:3px;}
    </style>
</head>
  <body style="background-color:#EBFCF3">
   <s:include value="/admin/header.jsp"></s:include>
	<center><div id="m" style="background-color: white">
	 <div id="ma">
	<table >
	<tr>
	  <td><div id="ma1" ><h4>您当前浏览的信息为：<img  src="/my.photo/photo/to.gif" />江西低碳</h4></div> 
	  </td>
	</tr>       
	   <%
    int pageSize=20;                                     //每页显示条数
    int recordCount=contents.size();   //总记录数
    int currentPage=1;                                   //当前页
    String currentPageStr=request.getParameter("page");
    if(currentPageStr !=null){
    currentPage=Integer.parseInt(currentPageStr);
    }
    PageUtil pageUtil =new PageUtil(pageSize,recordCount,currentPage);
    for(int i=pageUtil.getFromIndex();i<pageUtil.getToIndex();i++){
        Content c=contents.get(i);
    %>
      <tr><td height="30px;"><img  src="/my.photo/photo/lg.jpg"/>&nbsp;&nbsp;<a href="getContenttextAction.action?CContent_ID=<%=c.getCContent_ID() %>" target="_blank"><%=c.getCContent_topic() %></a></td>
          <td align="left" width="150"><font style="font-size:14px;color:red">[<%=c.getCContent_time()%>]</font></td>
      </tr>
    <% 
    }
    %>
    <tr>
       <td colspan="4" height="80"   align="center">
           <font style="font-size: 14px;"> 记录总数<%=recordCount %>条   每页显示<%=pageSize %>条   当前页/总页数  <%=pageUtil.getCurrentPage() %>/<%=pageUtil.getPageCount()%>
           <a href="jxtc.jsp?page=1">首页</a>  
           <a href="jxtc.jsp?page=<%=pageUtil.getPrevPage() %>">上页 </a>|       
           <a href="jxtc.jsp?page=<%=pageUtil.getNextPage() %>">下页 </a>|
           <a href="jxtc.jsp?page=<%=pageUtil.getPageCount() %>">末页 </a>
              跳到<input type="text" size="3" id="newPage">页 </font>
        <input type="button"  value="GO" onclick="processGoPage()" > 
           <script type="text/javascript">
				function processGoPage() {
			    var newPage = document.getElementById("newPage").value;
	            var reg = /\d+$/;	
	            if(!newPage.match(reg))	{
				alert('页面格式不合法');
				document.getElementById("newPage").focus();
				}
				else{
				window.location.href="jxtc.jsp?page="+newPage}
				}
          </script>
     </td>
  </tr>
     </table>
     </div>
	</div></center>
	<s:include value="/admin/tail.jsp"></s:include>
</body>
</html>
